package com.endava.first;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ParsingCodIban {
	public static void main(String[] args) {
		//functioneaza pentru banci din romania, fiind valid pt 7 din ele:
		//BT, BCR, OTP, RAIFFEISEN, ING, VOLKSBANK, BANCA CARPATICA(lista e ft lunga)
		//dar si altele create random 
		Pattern p1 = Pattern.compile("RO[0-9]{2}(BTRL|CARP|RNCB|RZBR|BNRB|VBBU|INGB|[A-Z]{4})[A-Z0-9]{16}");

		Matcher m1 = p1.matcher("RO12BTRLEUR1234567897634 or RO12WWWWleu1234567891234 RO23BRTL1234567891234512 RO43BNRB");
		while(m1.find()) {
			System.out.println(m1.start() + " " + m1.group());
		}
	}
}
